#!/usr/bin/env python
# coding=utf-8
"""
# @Created on : 2016/08/08 下午6:15
# @Author     : 李定方 (ldf@eehello.com)
# @Link       : http://www.eehello.com
# @Version    : 
# 本程序在python2.7下测试通过
"""

from flask import Flask, request
from flask.ext.script import Manager

app = Flask(__name__)
manager = Manager(app)


@app.route('/')
def index():
    return '<h1>Hello flask!</h1>'

@app.route('/user/<name>')
def user(name):
    return '<h1>Hello %s!</h1>' % name

@app.route('/browser')
def browser():
    user_agent = request.headers.get('User-Agent')
    return '<p>Your browser is %s</p>' % user_agent

@app.route('/400')
def error():
    return '<h1>This is a error page!</>', 400




if __name__ == "__main__":
    #app.run(debug=True)
    manager.run()

